<?php

class Navbar extends Zend_Db_Table{
  protected $_name = 'navbar';
  protected $_primary = 'id';

  public function getNavbar(){
      return $this->fetchAll();
  }

  public function getNavById($id){
      $db = $this->getAdapter();
      $where = $db->quoteInto('id = ?', $id);
      return $this->fetchRow($where);
  }

  public function updateNav($id, $set){
      $db = $this->getAdapter();
      $where = $db->quoteInto('id = ?', $id);
      return $this->update($set, $where);
  }

  public function addNav($set){
      return $this->insert($set);
  }

  public function deleteNav($id){
      $db = $this->getAdapter();
      $where = $db->quoteInto('id = ?', $id);
      return $this->delete($where);
  }
}
